<div class="main-content">
    <!-- Content Header (Page header) -->
    <div class="breadcrumbs" id="breadcrumbs">
    	<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>
		<ul class="breadcrumb">
			<li>
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>

			<li>
				<a href="#">网站管理</a>
			</li>
			<li>
				<a href="#">友情链接</a>
			</li>
			<li class="active">编辑</li>
		</ul><!-- .breadcrumb -->
    </div>
    <div class="page-content">
        <div class="row">
            <div class="page-header">
    			<h1>编辑友情链接</h1>
    		</div>
    		<div class="col-xs-12 margin_t">
    		<?php if (validation_errors()!=''){?>
	           <div id="info_msg" class="alert alert-danger"><?php echo validation_errors();?></div>
	        <?php }?>
				<!-- PAGE CONTENT BEGINS -->

				<form id="usrform" role="form" action="<?php echo base_url().'admin/website/edit_links/'.$links->id;?>" method="post">
				<input type="hidden" name="id" value="<?php if (isset($links->id))echo $links->id;?>">
				<div class="box-body" style="display: inline-block;width: 100%">
					<div class="form-group" style="width: 100%;">
						<label>链接名称：</label>
						<input type="text" id="form-field-1" class="form-control" name="link_name" check-type="required" value="<?php if (validation_errors()!='')echo set_value('link_name');elseif (isset($links->link_name))echo $links->link_name;?>"/>
					</div>
					<div class="form-group" style="width: 100%;">
						<label>链接地址：</label>
						<input type="text" id="form-field-1" class="form-control" name="link_url" check-type="required" value="<?php if (validation_errors()!='')echo set_value('link_url');elseif (isset($links->link_url))echo $links->link_url;?>"/>
					</div>
					</div>
                    <div class="clearfix form-actions">
						<div class="col-md-offset-3 col-md-9">
							<button class="btn btn-info" type="submit" id="btnSubmit">
								<i class="icon-ok bigger-110"></i>
								保存
							</button>

							&nbsp; &nbsp; &nbsp;
							<a class="btn" href="<?php echo base_url()."admin/website/links"?>">
								<i class="icon-undo bigger-110"></i>
								返回
							</a>
						</div>
					</div>
				</form>
					
			</div>

			<!-- /.col -->
		</div><!-- /.row -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->
<script type="text/javascript">
	$("#usrform").validation();
	//保存
	$("#btnSubmit").on('click',function(event){
	  // 2.最后要调用 valid()方法。
	  if ($("#usrform").valid()==false){
	    return false;
	  }
	});
</script>